using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace SmartSoft.ADP
{
    public class AdapterInstance
    {        
        private static bool _IsRemoteConnected = false;
        public static bool IsRemoteConnected
        {
            set
            {
                _IsRemoteConnected = value;
                SmartSoft.DAL.SSDataAccess.IsRemoteConnected = value;
            }
            get
            {                
                return _IsRemoteConnected;
            }
        }

        private static string _ServerIp = "localhost";
        public static string ServerIp
        {
            get { return _ServerIp; }
            set
            {
                _ServerIp = value;
                SSDataAccess.wDataAcess.Url = SSDataAccess.wDataAcess.Url.Replace("localhost", _ServerIp);
            }
        }

        public static string LocalVersion
        {
            get
            {
                return SmartSoft.DAL.SSDataAccess.Version;
            }
        }

        public static string RemoteVersion
        {
            get
            {
                AutoUpdateService.AutoUpdateService wDataAcess = new AutoUpdateService.AutoUpdateService();
                wDataAcess.Url = wDataAcess.Url.Replace("localhost", AdapterInstance.ServerIp);
                return wDataAcess.GetRemoteVersion();
            }
        }
    }
}
